package jiheyufanxing;

import java.util.HashMap;
import java.util.Map;

public class mapexample {
    public static void main(String[] args) {

        Map<String, Integer> map = new HashMap<>();
        map.put("Alice", 85);
        map.put("Bob", 90);
        map.put("Charlie", 78);

        int bobScore = map.get("Bob");
        System.out.println("Bob's score: " + bobScore);

        System.out.println("\nAll students' scores:");
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            System.out.println(entry.getKey() + ": " + entry.getValue());
        }

        map.remove("Charlie");
        System.out.println("\nMap after removing 'Charlie':");
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            System.out.println(entry.getKey() + ": " + entry.getValue());
        }
    }
}